<template>
<div>
    <header1>
        <template #left>
            返回
        </template>
    </header1>
   <keep-alive>
        <component :is="comName" ></component>
   </keep-alive>
   <hmnavbar :tablist='tablist'
                @changCom='changCom'></hmnavbar>
</div>

</template>

<script>
import header1 from './header'
import hminfo from './info'
import hmsearch from './search'
import hmgoods from './goods'
import hmnavbar from './navbar'
export default {
data(){
return {
    comName:'hmgoods',
    tablist: [
        {
          icon: 'icon-shangpinliebiao',
          text: '商品列表',
          name:'hmgoods'
        },
        {
          icon: 'icon-sousuo',
          text: '商品搜索',
          name:'hmsearch'
        },
        {
          icon: 'icon-user',
          text: '我的信息',
          name:'hminfo'
        },
      ]
}

},
components: {
    header1,hminfo,hmsearch,hmgoods,hmnavbar
},
methods: {
    changCom(data){
        this.comName=data
        console.log(data);
    }
}
}
</script>
<style lang='less' scoped>

</style>
